<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %><%--
  Created by IntelliJ IDEA.
  User: oldliu
  Date: 2022/6/30
  Time: 11:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link href="css/index.css" rel="stylesheet">
    <script>
        alert(666);
    </script>
</head>
<body>
<%!
     String dateToStr(Date d, String pattern){
         SimpleDateFormat df=new SimpleDateFormat(pattern);
         return df.format(d);
     }
%>
<h1>给大家的忠告</h1>
  <img src="images/kongzi.jpg">
<%
    Date d=new Date();
    String s1=dateToStr(d,"yyyy/MM/dd");
    String s2=dateToStr(d,"yyyy.MM.dd k:mm:ss");
    out.print("<h6>"+s1+"</h6>");
%>
<hr/>
<h6><%=s2%></h6>
</body>
</html>
